#include <iostream>
using namespace std;

void Calculate_1_numbers(int n)
{
    int count = 0;
    while (n) {
        if(n % 2 == 1)
            count++;
        n /= 2;
    }
    cout << count << endl;
}

int main() {
    int n;
    while (cin >> n) 
    { 
        Calculate_1_numbers(n);
    }
    return 0;
}